package com.neusoft.yuejian12.yuejian_12.model;

import com.neusoft.yuejian12.yuejian_12.javabean.TrainBean;

import com.neusoft.yuejian12.yuejian_12.service.TrainService;
import java.util.List;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;

import static com.neusoft.yuejian12.yuejian_12.model.BaseModel.BASE_URL;


/**
 * Created by Administrator on 2017/9/25.
 */

public class TrainModel{
    private Retrofit retrofit;
    public TrainModel(){
        //创建实例
        retrofit =new Retrofit.Builder()
                .baseUrl(BASE_URL)
                .addConverterFactory(GsonConverterFactory.create())
                .build();
    }

//培训列表a

    public Call<List<TrainBean>> getTrainlist(){
        TrainService trainService = retrofit.create(TrainService.class);
        return trainService.getTrainlist();
    }

    public Call<List<TrainBean>> getTrainlista(){
        TrainService trainService = retrofit.create(TrainService.class);
        return trainService.getTrainlista();
    }

    public Call<List<TrainBean>> getTrainlistb(){
        TrainService trainService = retrofit.create(TrainService.class);
        return trainService.getTrainlistb();
    }
    public Call<List<TrainBean>> getTrainlistc(){
        TrainService trainService = retrofit.create(TrainService.class);
        return trainService.getTrainlistc();
    }
    public Call<List<TrainBean>> getTrainlistd(){
        TrainService trainService = retrofit.create(TrainService.class);
        return trainService.getTrainlistd();
    }


//培训详情
    public Call<TrainBean> getDetail(int t_id){
        TrainService trainService = retrofit.create(TrainService.class);
        return trainService.getDetail(t_id);
    }

    //搜索培训
    public Call<List<TrainBean>> searchTrain(String t_name){
        TrainService trainService = retrofit.create(TrainService.class);
        return trainService.searchTrain(t_name);
    }
}
